Skip to content

Print current source names (snapshot list & show)#417

Closed
winged wants to merge 3 commits intoaptly-dev:masterfrom
adfinis-forks:description_list_with_current_sources
Closed

Print current source names (snapshot list & show)#417
winged wants to merge 3 commits intoaptly-dev:masterfrom
adfinis-forks:description_list_with_current_sources

Conversation

@winged
Copy link

@winged winged commented Jun 17, 2016

When renaming a snapshot that was referenced by another via snapshot merge,
then the references are not updated. Consider the following:

$ aptly snapshot create foo from repo xyz
$ aptly snapshot merge bar foo
$ aptly snapshot rename foo foo3
$ aptly snapshot list
List of snapshots:
 * [foo3]: Snapshot from repo...
 * [bar]: Merged from sources: 'foo'

As you can see, after renaming the "source" snapshot, it's stored description
may refer to a snapshot that does no longer exist.

This change always generates the description from the actual source snapshots,
so it will point to the right (current) snapshot name, even after renames.

David Vogt added 2 commits November 10, 2016 09:07
When renaming a snapshot that was referenced by another via snapshot merge,
then the references are not updated. Consider the following:

  $ aptly snapshot create foo from repo xyz
  $ aptly snapshot merge bar foo
  $ aptly snapshot list
  List of snapshots:
   * [foo]: Snapshot from repo...
   * [bar]: Merged from sources: 'foo'
  $ aptly snapshot rename foo foo3
  $ aptly snapshot list
  List of snapshots:
   * [foo3]: Snapshot from repo...
   * [bar]: Merged from sources: 'foo'

As you can see, after renaming the "source" snapshot, it's stored description
may refer to a snapshot that does no longer exist.

This change always generates the description from the actual source snapshots,
so it will point to the right (current) snapshot name, even after renames.
In the previous commit, we modified "snapshot list" and "snapshot show"
to always output the current names of their source snapshots. In this
change, the same is also done for "publish list".

Now, the snapshots listed in "aptly publish list" are guaranteed to exist, even
if they have been renamed:

    $ aptly publish list
    Published repositories:
      * ./stable [amd64] publishes {main: [foo]: Merged from sources: 'fblub', 'asdfasdf'}
    $ aptly snapshot rename asdfasdf foo23
    Snapshot asdfasdf -> foo23 has been successfully renamed.
    $ aptly publish list
    Published repositories:
      * ./stable [amd64] publishes {main: [foo]: Merged from sources: 'fblub', 'foo23'}
@winged winged force-pushed the description_list_with_current_sources branch from 2acf059 to 21b3e9b Compare November 10, 2016 08:07
@winged
Copy link
Author

winged commented Jan 13, 2017

So it turns out that my version was rather incomplete. My colleague @sliverc built a much cleaner implementation in #472 so I think we should roll with that instead.

@winged winged closed this Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant